﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using System.IO;
using JumbotCms.Common;
namespace JumbotCms.WebFile.Admin
{
    public partial class _config_message : JumbotCms.API.AdminCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Admin_Load("0000", "html");
            if (!Page.IsPostBack)
            {
                string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/message.config");
                Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
                string _SystemUserId = XmlTool.GetText("Messages/System/UserId");
                string _SystemUserName = XmlTool.GetText("Messages/System/UserName");
                string _ServiceUserId = XmlTool.GetText("Messages/Service/UserId");
                string _ServiceUserName = XmlTool.GetText("Messages/Service/UserName");
                this.txtSystemUserId.Text = _SystemUserId;
                this.txtSystemUserName.Text = _SystemUserName;
                this.txtServiceUserId.Text = _ServiceUserId;
                this.txtServiceUserName.Text = _ServiceUserName;
                XmlTool.Dispose();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/message.config");
            Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
            XmlTool.Update("Messages/System/UserId", this.txtSystemUserId.Text);
            XmlTool.Update("Messages/System/UserName", this.txtSystemUserName.Text);
            XmlTool.Update("Messages/Service/UserId", this.txtServiceUserId.Text);
            XmlTool.Update("Messages/Service/UserName", this.txtServiceUserName.Text);
            XmlTool.Save();
            XmlTool.Dispose();
            FinalMessage("保存成功!", "message.aspx", 0);
        }
    }
}
